ostbuild: Allow using dirty-git: for patches too
authorColin Walters <walters@verbum.org>
Wed, 9 May 2012 23:40:24 +0000 (19:40 -0400)
committerColin Walters <walters@verbum.org>
Wed, 9 May 2012 23:40:24 +0000 (19:40 -0400)
src/ostbuild/pyostbuild/builtin_checkout.py

index f9cba416f7d0c224592b86d2b08bee5016b464dc..9a2d1f9d34eafbd33d904d2e9ee9fa168731961c 100755 (executable)
@@ -91,14 +91,18 @@ class OstbuildCheckout(builtins.Builtin):
             patches = component.get('patches')
             if patches is not None:
                 (patches_keytype, patches_uri) = buildutil.parse_src_key(patches['src'])
-                patches_mirror = buildutil.get_mirrordir(self.mirrordir, patches_keytype, patches_uri)
-                vcs.get_vcs_checkout(self.mirrordir, patches_keytype, patches_uri,
-                                     self.patchdir, patches['branch'],
-                                     overwrite=True)
+                if patches_keytype == 'git':
+                    patches_mirror = buildutil.get_mirrordir(self.mirrordir, patches_keytype, patches_uri)
+                    vcs.get_vcs_checkout(self.mirrordir, patches_keytype, patches_uri,
+                                         self.patchdir, patches['branch'],
+                                         overwrite=True)
+                    patchdir = self.patchdir
+                else:
+                    patchdir = patches_uri
 
                 patch_subdir = patches.get('subdir', None)
                 if patch_subdir is not None:
-                    patchdir = os.path.join(self.patchdir, patch_subdir)
+                    patchdir = os.path.join(patchdir, patch_subdir)
                 else:
                     patchdir = self.patchdir
                 for patch in patches['files']: